package com.sky.mapper;

import com.sky.annotation.AutoFill;
import com.sky.entity.Setmeal;
import com.sky.entity.SetmealDish;
import com.sky.enumeration.OperationType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.web.bind.annotation.DeleteMapping;

import java.util.List;

@Mapper
public interface SetmealDishMapper {

    List<Long> getSetmealIdsByDishIds(List<Long> dishIds);
//    根据id查询套餐
    List<SetmealDish> getSetmealDish(Long id);
//向套餐中添加数据
    @AutoFill(OperationType.INSERT)
    void insert(Setmeal setmeal);
//加入菜品数据
    void insertBatch(List<SetmealDish> setmealDishes);
//根据id删除菜品数据
    @Delete("delete from setmeal_dish where id = #{id}")
    void deleteById(Long id);
}
